﻿using CleanArchitecture.Core.SharedKernel;
using System;

namespace CleanArchitecture.Infrastructure.Entities.Business
{
    public partial class Comment : BaseEntity
    {
        /// <summary>
        /// 冗余兼容-对于文章留言、商品评价等进行扩展支持，记录如NewsComment 的News Id 
        /// 如果是系统留言 则Id为0
        /// </summary>
        public int EntityId { get; set; }
        /// <summary>
        /// 记录如NewsComment 的NewsEntity Name 
        /// </summary>
        public string EntityName { get; set; }
        /// <summary>
        /// 留言类型 - 如留言/回复/评价
        /// </summary>
        public EntityEnumConfig.CommentType CommentType { get; set; }

        /// <summary>
        /// 留言树根节点Id : 完整留言树包括用户留言/系统回复/追加评论等，记录留言根节点ID，便于SQL查询完整评论记录
        /// 当为根节点留言时，RootId = ParentId = Id
        /// </summary>
        public int RootId { get; set; }
        /// <summary>
        /// 留言树关系中回复或追加评论所关联的父节点Id
        /// 当为根节点留言时，RootId = ParentId = Id
        /// </summary>
        public int ParentId { get; set; }
        /// <summary>
        /// 预留 商品或登录用户才能评价时记录用户Id，默认为0
        /// </summary>
        public int CustomerId { get; set; }
        /// <summary>
        /// Gets or set CommentTitle
        /// </summary>
        public string CommentTitle { get; set; }
        /// <summary>
        /// Gets or set CommentText , ResponseText when commenttype is response 
        /// </summary>
        public string CommentText { get; set; }
        /// <summary>
        /// 冗余保留 不论商品评价还是系统回复，记录留言用户联系名称
        /// </summary>
        public string ContactName { get; set; }
        /// <summary>
        /// 冗余保留 不论商品评价还是系统回复，记录留言用户联系方式
        /// </summary>
        public string ContactPhone { get; set; }
        /// <summary>
        /// 冗余保留 不论商品评价还是系统回复，记录留言用户联系方式
        /// </summary>
        public string ContactEmail { get; set; }
        /// <summary>
        /// 冗余保留 不论商品评价还是系统回复，记录留言用户联系方式
        /// </summary>
        public string ContactAddress { get; set; }
        public EntityEnumConfig.YesorNo CommentIsResponsed { get; set; }
        /// <summary>
        /// Gets or sets the flag image file name
        /// </summary>
        public EntityEnumConfig.YesorNo IsActive { get; set; }

        /// <summary>
        /// Gets or sets the Comment CreatedTime
        /// </summary>
        public DateTime CreatedOnTimeUtc { get; set; }
        /// <summary>
        /// 商品评价或留言需要上传图片时记录fileupload id,多图时id以逗号分隔
        /// </summary>
        public string ImgIds { get; set; }

    }
}
